package com.square.service.auth.consumer.feign;

import com.baomidou.mybatisplus.extension.api.R;
import com.square.service.auth.consumer.fallback.AuthFeignFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 认证消费Feign
 *
 * @author : 王苏
 * @since : 2021/4/20 15:18
 */
@Component
@FeignClient(name = "auth", fallback = AuthFeignFallback.class)
public interface AuthFeign {
    /**
     * 登录认证
     */
    @GetMapping("/rpc/auth/doGetAuthenticationInfo")
    R<?> doGetAuthenticationInfo(@RequestParam("token") String token);

    /**
     * 角色认证
     */
    @GetMapping("/rpc/auth/doGetAuthorizationInfoForRoles")
    R<?> doGetAuthorizationInfoForRoles(@RequestParam("userKey") String userKey, @RequestParam("value") String[] value);

    /**
     * 权限认证
     */
    @GetMapping("/rpc/auth/doGetAuthorizationInfoForPermissions")
    R<?> doGetAuthorizationInfoForPermissions(@RequestParam("userKey") String userKey, @RequestParam("value") String[] value);
}
